package o;

import androidx.fragment.app.Fragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.protocol.ITabFragmentProtocol;
import java.util.HashMap;
import java.util.Map;

public class chk {
    private static Map<Integer, String> ॱ = new HashMap();

    public static void ˊ(int i, String str) {
        ॱ.put(Integer.valueOf(i), str);
    }

    public static Fragment ˊ(int i, chx o_chx) {
        String str = (String) ॱ.get(Integer.valueOf(i));
        if (str == null) {
            return chh.ˋ(o_chx);
        }
        try {
            cjo ˏ = new cjq(str).ˎ().ˏ();
            if (ˏ instanceof ITabFragmentProtocol) {
                ((chv) ((ITabFragmentProtocol) ˏ).ˊ()).ˎ(o_chx);
                return cjk.ˎ().ˊ(new cjm(str, ˏ));
            }
            Logger.ˋ("SecondaryTabRegister", "getTabFragmentOffer failed, protocol = " + ˏ);
            return null;
        } catch (IllegalArgumentException e) {
            Logger.ˋ("SecondaryTabRegister", "getTabFragmentOffer IllegalArgumentException!");
            return null;
        } catch (ClassCastException e2) {
            Logger.ˋ("SecondaryTabRegister", "getTabFragmentOffer ClassCastException!");
            return null;
        }
    }
}
